package com.wz.jiangsu;

public class Demo {

    public static void main(String[] args) throws InterruptedException {

        while (true) {



            new Thread(() -> {
                try {
                    handle1();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            },"aaa").start();


            new Thread(() -> {
                try {
                    handle2();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            },"bbb").start();



            new Thread(() -> {
                try {
                    handle3();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            },"ccc").start();



            new Thread(() -> {
                try {
                    handle4();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            },"ddd").start();
        }
    }
    private static void handle4() throws InterruptedException{
        Thread.sleep(1000);
    }
    private static void handle2()throws InterruptedException {
        Thread.sleep(50);
    }

    private static void handle3() throws InterruptedException{
        Thread.sleep(100);
    }
    private static void handle1() throws InterruptedException{
        Thread.sleep(50);
    }
}
